package cn.school.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 *
 * @TableName exam_appoint
 */
@TableName(value ="exam_appoint")
@Data
public class ExamAppoint implements Serializable {
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     *
     */
    private Integer sessionId;

    /**
     *
     */
    private Long paperExamId;

    /**
     *
     */
    private Long studentsId;

    /**
     * 0-未开始 1-考试中 2-考试结束 3-缺考 4-取消预约
     */
    private Integer examStatus;

    /**
     *
     */
    private Integer isDel;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ExamAppoint other = (ExamAppoint) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getSessionId() == null ? other.getSessionId() == null : this.getSessionId().equals(other.getSessionId()))
            && (this.getPaperExamId() == null ? other.getPaperExamId() == null : this.getPaperExamId().equals(other.getPaperExamId()))
            && (this.getStudentsId() == null ? other.getStudentsId() == null : this.getStudentsId().equals(other.getStudentsId()))
            && (this.getExamStatus() == null ? other.getExamStatus() == null : this.getExamStatus().equals(other.getExamStatus()))
            && (this.getIsDel() == null ? other.getIsDel() == null : this.getIsDel().equals(other.getIsDel()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getSessionId() == null) ? 0 : getSessionId().hashCode());
        result = prime * result + ((getPaperExamId() == null) ? 0 : getPaperExamId().hashCode());
        result = prime * result + ((getStudentsId() == null) ? 0 : getStudentsId().hashCode());
        result = prime * result + ((getExamStatus() == null) ? 0 : getExamStatus().hashCode());
        result = prime * result + ((getIsDel() == null) ? 0 : getIsDel().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", sessionId=").append(sessionId);
        sb.append(", paperExamId=").append(paperExamId);
        sb.append(", studentsId=").append(studentsId);
        sb.append(", examStatus=").append(examStatus);
        sb.append(", isDel=").append(isDel);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
